package tomoto.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Properties;
import java.util.ResourceBundle;

public class XMLResourceBundle extends ResourceBundle {
	private Properties props;
	
	public XMLResourceBundle(InputStream in) throws IOException {
		props = new Properties();
		props.loadFromXML(in);
	}

	@SuppressWarnings("unchecked")
	@Override
	public Enumeration<String> getKeys() {
		return (Enumeration<String>) props.propertyNames();
	}

	@Override
	protected Object handleGetObject(String key) {
		return props.get(key);
	}

}
